package fr.n7.khome.dao;

import java.util.Collection;

import fr.n7.khome.model.Lodging;

/**
 * This interface provides functions in order to manage objects in a database.
 * Objects can be created, read, updated and deleted. It is also possible to list
 * all objects in the database.
 * 
 * @author bbaccot && clej37
 *
 */
public interface LodgingDAO {

	/**
	 * Put a lodging in the database.
	 * @param l - the lodging to add
	 * @return the id of the added lodging
	 */
	public Long create(Lodging l);
	
	/**
	 * Read a lodging from the database
	 * @param id - the id of the lodging
	 * @return the lodging with the given id
	 */
	public Lodging read(Long id);
	
	/**
	 * Update a lodging already present in the database.
	 * @param l - the lodging
	 */
	public void update(Lodging l);
	
	/**
	 * Delete a lodging from the database.
	 * @param l - the lodging
	 */
	public void delete(Lodging l);
	
	/**
	 * List all lodgings in the dabase.
	 * @return
	 */
	public Collection<Lodging> listAll();
}
